

class CustomerAdditionBean {
  List<CustomerBeanData>? customerBean;
  String? msg;
  int? status;

  CustomerAdditionBean({this.customerBean, this.msg, this.status});

  CustomerAdditionBean.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      customerBean = <CustomerBeanData>[];
      json['data'].forEach((v) {
        customerBean!.add(CustomerBeanData.fromJson(v));
      });
    }
    msg = json['msg'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (customerBean != null) {
      data['data'] =
          customerBean!.map((v) => v.toJson()).toList();
    }
    data['msg'] = msg;
    data['status'] = status;
    return data;
  }
}

class CustomerBeanData {
  String? bCCODE;
  String? bCNAME;
  String? bGCODE;
  String? bGNAME;
  int? bLBILLNUM;
  int? bLCOST;
  dynamic? bLPCOST;
  String? cMADDRESS;
  String? cMCODE;
  String? cMCONTACTS;
  String? cMFAX1;
  int? cMMONTHCOST;
  String? cMNAME;
  int? cMORDERNUM;
  dynamic cMOVERFULL;
  dynamic cMPHONE1;
  String? cMREGISTERBEGIN;
  String? cMREGISTEREND;
  String? cMREMARK;
  String? cMTYPE;
  String? t;
  dynamic u;

  CustomerBeanData(
      {this.bCCODE,
        this.bCNAME,
        this.bGCODE,
        this.bGNAME,
        this.bLBILLNUM,
        this.bLCOST,
        this.bLPCOST,
        this.cMADDRESS,
        this.cMCODE,
        this.cMCONTACTS,
        this.cMFAX1,
        this.cMMONTHCOST,
        this.cMNAME,
        this.cMORDERNUM,
        this.cMOVERFULL,
        this.cMPHONE1,
        this.cMREGISTERBEGIN,
        this.cMREGISTEREND,
        this.cMREMARK,
        this.cMTYPE,
        this.t,
        this.u,});

  CustomerBeanData.fromJson(Map<String, dynamic> json) {
    bCCODE = json['BC_CODE']??"";
    bCNAME = json['BC_NAME']??"";
    bGCODE = json['BG_CODE']??"";
    bGNAME = json['BG_NAME']??"";
    bLBILLNUM = json['BL_BILLNUM'];
    bLCOST = json['BL_COST'];
    bLPCOST = json['BL_PCOST'];
    cMADDRESS = json['CM_ADDRESS']??"";
    cMCODE = json['CM_CODE']??"";
    cMCONTACTS = json['CM_CONTACTS']??"";
    cMFAX1 = json['CM_FAX1']??"";
    cMMONTHCOST = json['CM_MONTHCOST'];
    cMNAME = json['CM_NAME']??"";
    cMORDERNUM = json['CM_ORDERNUM'];
    cMOVERFULL = json['CM_OVERFULL'];
    cMPHONE1 = json['CM_PHONE1']??"";
    // bGNAME = GroupType.getGroupName(json['CM_CODE'].toString(), json['groupName']);

    var betinTime = DateTime.fromMillisecondsSinceEpoch(json['CM_REGISTERBEGIN']);
    String betinTimeStr = "${betinTime.year}-${betinTime.month.toString().padLeft(2, '0')}-${betinTime.day.toString().padLeft(2, '0')}";
    var endTime = DateTime.fromMillisecondsSinceEpoch(json['CM_REGISTEREND']);
    String endTimeStr = "${endTime.year}-${endTime.month.toString().padLeft(2, '0')}-${endTime.day.toString().padLeft(2, '0')}";
    cMREGISTERBEGIN = betinTimeStr;
    cMREGISTEREND = endTimeStr;
    cMREMARK = json['CM_REMARK']??"";
    cMTYPE = json['CM_TYPE']??"";
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['BC_CODE'] = bCCODE;
    data['BC_NAME'] = bCNAME;
    data['BG_CODE'] = bGCODE;
    data['BG_NAME'] = bGNAME;
    data['BL_BILLNUM'] = bLBILLNUM;
    data['BL_COST'] = bLCOST;
    data['BL_PCOST'] = bLPCOST;
    data['CM_ADDRESS'] = cMADDRESS;
    data['CM_CODE'] = cMCODE;
    data['CM_CONTACTS'] = cMCONTACTS;
    data['CM_FAX1'] = cMFAX1;
    data['CM_MONTHCOST'] = cMMONTHCOST;
    data['CM_NAME'] = cMNAME;
    data['CM_ORDERNUM'] = cMORDERNUM;
    data['CM_OVERFULL'] = cMOVERFULL;
    data['CM_PHONE1'] = cMPHONE1;
    data['CM_REGISTERBEGIN'] = cMREGISTERBEGIN;
    data['CM_REGISTEREND'] = cMREGISTEREND;
    data['CM_REMARK'] = cMREMARK;
    data['CM_TYPE'] = cMTYPE;
    data['t'] = t;
    data['u'] = u;
    return data;
  }
}
